$_SERVER
Type
keyword
Summary
$_SERVER is an array variable containing the CGI interface related variables, along with any HTTP_* variables that are available.
Syntax
$_SERVER
Description
Use the $_SERVER keyword to access the CGI interface related variables, along with any HTTP_* variables that are available.
$_SERVER is only available when running in CGI mode (Server).
The list of CGI variables is:
- GATEWAY_INTERFACE
- SERVER_ADDR
- SERVER_NAME
- SERVER_SOFTWARE
- SERVER_PROTOCOL
- REQUEST_METHOD
- REQUEST_TIME
- QUERY_STRING
- DOCUMENT_ROOT
- HTTPS
- REMOTE_USER
- REDIRECT_REMOTE_USER
- REMOTE_ADDR
- REMOTE_HOST
- REMOTE_PORT
- SERVER_ADMIN
- SERVER_PORT
- SERVER_SIGNATURE
- PATH_TRANSLATED
- REQUEST_URI
- PATH_INFO
- SCRIPT_NAME
- SCRIPT_FILENAME
- CONTENT_TYPE
- CONTENT_LENGTH
note
$_SERVER can be modified doing so has no effect and should be avoided (indeed, it might become read-only in future).
Examples
put $_SERVER into tServerArray
put $_SERVER['QUERY_STRING'] into tQueryString
if $_SERVER['SERVER_ADDR'] is "" then
... do something ...
end if
Related
Compatibility and Support
Introduced
LiveCode 4.6.3
OS
mac
windows
linux
Platforms
server